<?php


namespace app\admin\service\config;

use app\admin\model\config\ExchangeConfig;
use app\admin\service\BaseService;

/**
 * 行为日志-服务类
 * @author tangsan
 * Class ActionLogService
 * @package app\admin\service
 */
class ExchangeConfigService extends BaseService
{
    /**
     * 构造函数
     * @author tangsan
     * ActionLogService constructor.
     */
    public function __construct()
    {
        $this->model = new ExchangeConfig();
    }

    /**
     * 获取数据列表
     * @return array
     * @author tangsan
     */
    public function getList()
    {
//        $param = request()->param();
        // 用户账号
        $sort = 'ID desc';
        $result = $this->model->alias('e')
            ->field('e.*,t.ExchangeChannelName')
            ->join('Net_ExchangeType t', 'e.RequestID =t.RequestID')
            ->order($sort)->page(PAGE, PERPAGE)
            ->select()->toArray();
        //获取数据总数
        $count = $this->model->count();

        //返回结果
        $message = array(
            "msg" => '操作成功',
            "code" => 0,
            "data" => $result,
            "count" => $count,
        );
        return $message;
    }

}